#ifndef _TEST_APP
#define _TEST_APP

#include <iostream>
#include <fstream>
#include <vector>
using namespace std;

#include "ofMain.h"

#include "ofxVectorMath.h"
#include "../blob.h"
#include "../explosion.h"
#include "../explosionParticle.h"
#include "../gameObject.h"
#include "../VisualManager.h"
#include "../settings.h"

class blob;
class explosionParticle;


typedef  struct
{
    int time;
    char type;

} BeatData;
bool TimeBeatCompare (BeatData i,BeatData j);
class testApp : public ofBaseApp{

	public:
        vector<BeatData> BeatDataTimes;
        int currentBeatIndex;
		static float deltaTime;
		static float lastframe;
		void setup();
		void update();
		void draw();
		bool blend;
        void addGameObject(int type);

		void keyPressed  (int key);
		void keyReleased (int key);

		void mouseMoved(int x, int y );
		void mouseDragged(int x, int y, int button);
		void mousePressed(int x, int y, int button);
		void mouseReleased(int x, int y, int button);
		void windowResized(int w, int h);
		bool showDebugInfo;
		float nextPixelBeat;
		ofImage test1;
		ofImage test2;
protected:

	VisualManager* visuals;
	vector<blob*> gameObjects;
	int numTypes [2];
	vector<explosionParticle*> explosionParticles;
	vector<explosion*> explosions;

	blob* selectedBlob;
	bool readyForInput;
	float nextBlobSpawn;
	ofxVec2f mousePosition;
	bool mouseDown;

	blob* possibleTarget;
	void findPossibleTarget(blob* from);

};

#endif

